\(\int x (d+e x^2) (a+b \arctan (c x)) \, dx\) [1116]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 17, antiderivative size = 82 \[ \int x \left (d+e x^2\right ) (a+b \arctan (c x)) \, dx=-\frac {b \left (2 c^2 d-e\right ) x}{4 c^3}-\frac {b e x^3}{12 c}-\frac {b \left (c^2 d-e\right )^2 \arctan (c x)}{4 c^4 e}+\frac {\left (d+e x^2\right )^2 (a+b \arctan (c x))}{4 e} \]

[Out]

-1/4*b*(2*c^2*d-e)*x/c^3-1/12*b*e*x^3/c-1/4*b*(c^2*d-e)^2*arctan(c*x)/c^4/e+1/4*(e*x^2+d)^2*(a+b*arctan(c*x))/
e

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {5094, 398, 209} \[ \int x \left (d+e x^2\right ) (a+b \arctan (c x)) \, dx=\frac {\left (d+e x^2\right )^2 (a+b \arctan (c x))}{4 e}-\frac {b \arctan (c x) \left (c^2 d-e\right )^2}{4 c^4 e}-\frac {b x \left (2 c^2 d-e\right )}{4 c^3}-\frac {b e x^3}{12 c} \]

[In]

Int[x*(d + e*x^2)*(a + b*ArcTan[c*x]),x]

[Out]

-1/4*(b*(2*c^2*d - e)*x)/c^3 - (b*e*x^3)/(12*c) - (b*(c^2*d - e)^2*ArcTan[c*x])/(4*c^4*e) + ((d + e*x^2)^2*(a
+ b*ArcTan[c*x]))/(4*e)

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 398

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Int[PolynomialDivide[(a + b*x^n)
^p, (c + d*x^n)^(-q), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && IGtQ[p, 0] && ILt
Q[q, 0] && GeQ[p, -q]

Rule 5094

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*(x_)*((d_.) + (e_.)*(x_)^2)^(q_.), x_Symbol] :> Simp[(d + e*x^2)^(q + 1
)*((a + b*ArcTan[c*x])/(2*e*(q + 1))), x] - Dist[b*(c/(2*e*(q + 1))), Int[(d + e*x^2)^(q + 1)/(1 + c^2*x^2), x
], x] /; FreeQ[{a, b, c, d, e, q}, x] && NeQ[q, -1]

Rubi steps \begin{align*} \text {integral}& = \frac {\left (d+e x^2\right )^2 (a+b \arctan (c x))}{4 e}-\frac {(b c) \int \frac {\left (d+e x^2\right )^2}{1+c^2 x^2} \, dx}{4 e} \\ & = \frac {\left (d+e x^2\right )^2 (a+b \arctan (c x))}{4 e}-\frac {(b c) \int \left (\frac {\left (2 c^2 d-e\right ) e}{c^4}+\frac {e^2 x^2}{c^2}+\frac {c^4 d^2-2 c^2 d e+e^2}{c^4 \left (1+c^2 x^2\right )}\right ) \, dx}{4 e} \\ & = -\frac {b \left (2 c^2 d-e\right ) x}{4 c^3}-\frac {b e x^3}{12 c}+\frac {\left (d+e x^2\right )^2 (a+b \arctan (c x))}{4 e}-\frac {\left (b \left (c^2 d-e\right )^2\right ) \int \frac {1}{1+c^2 x^2} \, dx}{4 c^3 e} \\ & = -\frac {b \left (2 c^2 d-e\right ) x}{4 c^3}-\frac {b e x^3}{12 c}-\frac {b \left (c^2 d-e\right )^2 \arctan (c x)}{4 c^4 e}+\frac {\left (d+e x^2\right )^2 (a+b \arctan (c x))}{4 e} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.26 \[ \int x \left (d+e x^2\right ) (a+b \arctan (c x)) \, dx=-\frac {b d x}{2 c}+\frac {b e x}{4 c^3}+\frac {1}{2} a d x^2-\frac {b e x^3}{12 c}+\frac {1}{4} a e x^4+\frac {b d \arctan (c x)}{2 c^2}-\frac {b e \arctan (c x)}{4 c^4}+\frac {1}{2} b d x^2 \arctan (c x)+\frac {1}{4} b e x^4 \arctan (c x) \]

[In]

Integrate[x*(d + e*x^2)*(a + b*ArcTan[c*x]),x]

[Out]

-1/2*(b*d*x)/c + (b*e*x)/(4*c^3) + (a*d*x^2)/2 - (b*e*x^3)/(12*c) + (a*e*x^4)/4 + (b*d*ArcTan[c*x])/(2*c^2) -
(b*e*ArcTan[c*x])/(4*c^4) + (b*d*x^2*ArcTan[c*x])/2 + (b*e*x^4*ArcTan[c*x])/4

Maple [A] (verified)

Time = 0.16 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.06

method result size
parts \(\frac {a \left (e \,x^{2}+d \right )^{2}}{4 e}+\frac {b e \arctan \left (c x \right ) x^{4}}{4}+\frac {b \arctan \left (c x \right ) x^{2} d}{2}-\frac {b e \,x^{3}}{12 c}-\frac {b d x}{2 c}+\frac {b e x}{4 c^{3}}+\frac {b d \arctan \left (c x \right )}{2 c^{2}}-\frac {b e \arctan \left (c x \right )}{4 c^{4}}\) \(87\)
parallelrisch \(\frac {3 x^{4} \arctan \left (c x \right ) b \,c^{4} e +3 x^{4} a \,c^{4} e +6 x^{2} \arctan \left (c x \right ) b \,c^{4} d -b \,c^{3} e \,x^{3}+6 x^{2} a \,c^{4} d -6 b \,c^{3} d x +6 b \,c^{2} d \arctan \left (c x \right )+3 b c e x -3 e b \arctan \left (c x \right )}{12 c^{4}}\) \(98\)
derivativedivides \(\frac {\frac {a \left (e \,c^{2} x^{2}+c^{2} d \right )^{2}}{4 c^{2} e}+\frac {\arctan \left (c x \right ) b \,c^{2} d \,x^{2}}{2}+\frac {\arctan \left (c x \right ) b \,c^{2} e \,x^{4}}{4}-\frac {b c d x}{2}-\frac {b c e \,x^{3}}{12}+\frac {b e x}{4 c}+\frac {\arctan \left (c x \right ) b d}{2}-\frac {b e \arctan \left (c x \right )}{4 c^{2}}}{c^{2}}\) \(100\)
default \(\frac {\frac {a \left (e \,c^{2} x^{2}+c^{2} d \right )^{2}}{4 c^{2} e}+\frac {\arctan \left (c x \right ) b \,c^{2} d \,x^{2}}{2}+\frac {\arctan \left (c x \right ) b \,c^{2} e \,x^{4}}{4}-\frac {b c d x}{2}-\frac {b c e \,x^{3}}{12}+\frac {b e x}{4 c}+\frac {\arctan \left (c x \right ) b d}{2}-\frac {b e \arctan \left (c x \right )}{4 c^{2}}}{c^{2}}\) \(100\)
risch \(-\frac {i \left (e \,x^{2}+d \right )^{2} b \ln \left (i c x +1\right )}{8 e}+\frac {i b d \,x^{2} \ln \left (-i c x +1\right )}{4}+\frac {i b \,d^{2} \ln \left (c^{2} x^{2}+1\right )}{16 e}+\frac {x^{4} e a}{4}+\frac {i e b \,x^{4} \ln \left (-i c x +1\right )}{8}-\frac {b \,d^{2} \arctan \left (c x \right )}{8 e}+\frac {x^{2} d a}{2}-\frac {b e \,x^{3}}{12 c}+\frac {b d \arctan \left (c x \right )}{2 c^{2}}-\frac {b d x}{2 c}-\frac {b e \arctan \left (c x \right )}{4 c^{4}}+\frac {b e x}{4 c^{3}}\) \(153\)

[In]

int(x*(e*x^2+d)*(a+b*arctan(c*x)),x,method=_RETURNVERBOSE)

[Out]

1/4*a*(e*x^2+d)^2/e+1/4*b*e*arctan(c*x)*x^4+1/2*b*arctan(c*x)*x^2*d-1/12*b*e*x^3/c-1/2*b*d*x/c+1/4*b*e*x/c^3+1
/2*b*d*arctan(c*x)/c^2-1/4*b*e*arctan(c*x)/c^4

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.09 \[ \int x \left (d+e x^2\right ) (a+b \arctan (c x)) \, dx=\frac {3 \, a c^{4} e x^{4} + 6 \, a c^{4} d x^{2} - b c^{3} e x^{3} - 3 \, {\left (2 \, b c^{3} d - b c e\right )} x + 3 \, {\left (b c^{4} e x^{4} + 2 \, b c^{4} d x^{2} + 2 \, b c^{2} d - b e\right )} \arctan \left (c x\right )}{12 \, c^{4}} \]

[In]

integrate(x*(e*x^2+d)*(a+b*arctan(c*x)),x, algorithm="fricas")

[Out]

1/12*(3*a*c^4*e*x^4 + 6*a*c^4*d*x^2 - b*c^3*e*x^3 - 3*(2*b*c^3*d - b*c*e)*x + 3*(b*c^4*e*x^4 + 2*b*c^4*d*x^2 +
 2*b*c^2*d - b*e)*arctan(c*x))/c^4

Sympy [A] (verification not implemented)

Time = 0.36 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.39 \[ \int x \left (d+e x^2\right ) (a+b \arctan (c x)) \, dx=\begin {cases} \frac {a d x^{2}}{2} + \frac {a e x^{4}}{4} + \frac {b d x^{2} \operatorname {atan}{\left (c x \right )}}{2} + \frac {b e x^{4} \operatorname {atan}{\left (c x \right )}}{4} - \frac {b d x}{2 c} - \frac {b e x^{3}}{12 c} + \frac {b d \operatorname {atan}{\left (c x \right )}}{2 c^{2}} + \frac {b e x}{4 c^{3}} - \frac {b e \operatorname {atan}{\left (c x \right )}}{4 c^{4}} & \text {for}\: c \neq 0 \\a \left (\frac {d x^{2}}{2} + \frac {e x^{4}}{4}\right ) & \text {otherwise} \end {cases} \]

[In]

integrate(x*(e*x**2+d)*(a+b*atan(c*x)),x)

[Out]

Piecewise((a*d*x**2/2 + a*e*x**4/4 + b*d*x**2*atan(c*x)/2 + b*e*x**4*atan(c*x)/4 - b*d*x/(2*c) - b*e*x**3/(12*
c) + b*d*atan(c*x)/(2*c**2) + b*e*x/(4*c**3) - b*e*atan(c*x)/(4*c**4), Ne(c, 0)), (a*(d*x**2/2 + e*x**4/4), Tr
ue))

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.07 \[ \int x \left (d+e x^2\right ) (a+b \arctan (c x)) \, dx=\frac {1}{4} \, a e x^{4} + \frac {1}{2} \, a d x^{2} + \frac {1}{2} \, {\left (x^{2} \arctan \left (c x\right ) - c {\left (\frac {x}{c^{2}} - \frac {\arctan \left (c x\right )}{c^{3}}\right )}\right )} b d + \frac {1}{12} \, {\left (3 \, x^{4} \arctan \left (c x\right ) - c {\left (\frac {c^{2} x^{3} - 3 \, x}{c^{4}} + \frac {3 \, \arctan \left (c x\right )}{c^{5}}\right )}\right )} b e \]

[In]

integrate(x*(e*x^2+d)*(a+b*arctan(c*x)),x, algorithm="maxima")

[Out]

1/4*a*e*x^4 + 1/2*a*d*x^2 + 1/2*(x^2*arctan(c*x) - c*(x/c^2 - arctan(c*x)/c^3))*b*d + 1/12*(3*x^4*arctan(c*x)
- c*((c^2*x^3 - 3*x)/c^4 + 3*arctan(c*x)/c^5))*b*e

Giac [F]

\[ \int x \left (d+e x^2\right ) (a+b \arctan (c x)) \, dx=\int { {\left (e x^{2} + d\right )} {\left (b \arctan \left (c x\right ) + a\right )} x \,d x } \]

[In]

integrate(x*(e*x^2+d)*(a+b*arctan(c*x)),x, algorithm="giac")

[Out]

sage0*x

Mupad [B] (verification not implemented)

Time = 0.34 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.04 \[ \int x \left (d+e x^2\right ) (a+b \arctan (c x)) \, dx=\frac {a\,d\,x^2}{2}+\frac {a\,e\,x^4}{4}-\frac {b\,d\,x}{2\,c}+\frac {b\,e\,x}{4\,c^3}+\frac {b\,d\,\mathrm {atan}\left (c\,x\right )}{2\,c^2}-\frac {b\,e\,\mathrm {atan}\left (c\,x\right )}{4\,c^4}+\frac {b\,d\,x^2\,\mathrm {atan}\left (c\,x\right )}{2}+\frac {b\,e\,x^4\,\mathrm {atan}\left (c\,x\right )}{4}-\frac {b\,e\,x^3}{12\,c} \]

[In]

int(x*(a + b*atan(c*x))*(d + e*x^2),x)

[Out]

(a*d*x^2)/2 + (a*e*x^4)/4 - (b*d*x)/(2*c) + (b*e*x)/(4*c^3) + (b*d*atan(c*x))/(2*c^2) - (b*e*atan(c*x))/(4*c^4
) + (b*d*x^2*atan(c*x))/2 + (b*e*x^4*atan(c*x))/4 - (b*e*x^3)/(12*c)